tricks for indices and logarithm